package cn.tedu.eb_film.redis.buildCache;

import cn.tedu.eb_film.service.MovieService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import java.time.LocalDateTime;

@Slf4j
public class MovieJob implements Job {

    @Autowired
    private MovieService movieService;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {

        movieService.rebuildCache();
        log.info("---------------------缓存重建了!!-----------------------");
    }
}
